package com.lc.cehui.ui.activity.home;

import android.os.Bundle;
import android.widget.TextView;

import com.hjq.bar.TitleBar;
import com.hjq.http.EasyHttp;
import com.hjq.http.listener.HttpCallback;
import com.lc.cehui.R;
import com.lc.cehui.app.AppActivity;
import com.lc.cehui.http.request.CompanyNaturalShowApi;
import com.lc.cehui.http.response.CompanyNaturalShowBean;
import com.lc.cehui.other.IntentKey;
import com.lc.cehui.util.SPUtil;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 资源共享详情页
 *
 * @return
 */
public class IntelligenceDetailsActivity extends AppActivity {

    @BindView(R.id.titleBar)
    TitleBar titleBar;
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.tv_people)
    TextView tvPeople;
    @BindView(R.id.tv_date)
    TextView tvDate;
    @BindView(R.id.tv_address)
    TextView tvAddress;
    @BindView(R.id.tv_jianjie)
    TextView tvJianjie;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_intelligencedetails;
    }

    @Override
    protected void initView() {
        company_natural_show();
    }

    private void company_natural_show() {
        EasyHttp.post(this)
                .api(new CompanyNaturalShowApi().setInfo_id(getIntent().getStringExtra("info_id")).setType_id(getIntent().getStringExtra("type_id")).setUserid(SPUtil.get(this, IntentKey.USERID,0)))
                .request(new HttpCallback<CompanyNaturalShowBean>(this) {

                    @Override
                    public void onSucceed(CompanyNaturalShowBean data) {

                        if (data.getCode().equals("200")) {
                            tvName.setText(data.getData().getTitle());
                            tvPeople.setText(data.getData().getExhibition_company());
                            tvDate.setText(data.getData().getExhibition_time());
                            tvAddress.setText(data.getData().getExhibition_range());
                            tvJianjie.setText(data.getData().getContent());


                        }

                    }
                });
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
